package com.testdemo;

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.Collection;

import junit.framework.Assert;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters; 

@RunWith(Parameterized.class)
public class JunitTestDemo {
	String myH;
	String myW;
	String expBmi;
	
	@Parameters
	public static Collection data() {
		System.out.println("data");
		Object [][]a = new Object [3][3];
		a[0][0] = "";
	    return Arrays.asList(
	        		new Object[][]{
	               {"159", "60","24"},
	               {"180", "60","19"},
	               {"190", "60","17"}
	        });
	}
	
	//构造函数，对变量进行初始化
	public JunitTestDemo(
			String h,
			String w,
			String bmi){
		System.out.println("JunitTestDemo");
		
		this.myH = h;
		myW = w;
		expBmi = bmi;
	       
	}

	@Test
	public void test00() {
		System.out.println("test00");
		
		System.out.println("param h :" + this.myH);
		System.out.println("param w :" + this.myW);
		System.out.println("param bmi :" + this.expBmi);
	}
	
	@Test
	public void test01(){
		System.out.println("test01");
		int a = 5;
	 	Assert.assertEquals(a, 5);
	   	Assert.assertEquals(true, false);
	}
	@Test
	public void test02(){
		System.out.println("test02");
	   	Assert.assertEquals(true, true);
	}

}
